/*
 * util.cpp
 *
 *  Created on: Sep 13, 2011
 *      Author: zyq
 */

#include "util.h"

long Sum(long* arr, long length)
{
	long total = 0;
	for (int i = 0; i < length; i++)
	{
		total += arr[i];
	}
	return total;
}

long Avg(long* arr, long length)
{
	return Sum(arr, length) / length;
}
